<html>
<head>
    <style>
    @page {
       size: 40mm 300mm;
       margin: 5mm;
    }
    body {
       word-wrap: break-word;
       margin: 5mm;
       border: 1px solid black;
       width: 18mm;
    }
    </style>
</head>
<body>
  <div style="font-size: 36mm;">ABC DEF</div>
  <div style="font-size: 9mm;">ABC</div>
</body>
</html>
